﻿using UnityEngine;

public class SampleObjectLayerListener : SampleObjectLayer.ISampleObjectLayerListener
{
    public void OnObjectVisibleChange(int id, bool isHide)
    {
        Debug.Log(string.Format("id {0} 显示状态 {1}", id, !isHide));

        var data = SampleObjectModel.GetData(id);
        if (isHide)
        {
            SampleObjectMananger.RemoveSampleObject(data.id);
        }
        else
        {
            SampleObjectMananger.CreateSampleObject(data.id, data.pos);
        }
    }
}